package com.example.demo.Mapper;

import com.example.demo.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface userMapper {
    @Select("select * from User")
    public List<User> findAll();

    @Insert("insert into User values (NULL,#{name},#{password},#{age},#{favourites},#{phone},#{sex},#{role})")
    public void Insert(User user);

    @Update("update User set name=#{name},password=#{password},age=#{age},favourites=#{favourites},phone=#{phone},sex=#{sex},role=#{role} where id=#{id}")
    public void Update(User user);

    @Delete("delete from User where id=#{id}")
    public void delete(int id);
}
